import gradio as gr

# 定义变量
URL = "http://127.0.0.1:8188/prompt"
INPUT_DIR = "D:\PycharmProjects\ComfyUI\ComfyUI\input"
OUTPUT_DIR = "D:\PycharmProjects\ComfyUI\ComfyUI\output"

# v2
def index_box():
    with gr.Blocks(analytics_enabled=False) as index:
        gr.Markdown("<div align='center'>"
                    " <h1>ComfyUI_Easy_Link</h1>"
                    "<h3>作者：Xik</h3>"
                    "</div>")

        with gr.Tab("图生图"):
            from ui.img_to_img import ImgToImg
            ImgToImg(URL=URL, INPUT_DIR=INPUT_DIR, OUTPUT_DIR=OUTPUT_DIR).ui()

        with gr.Tab("文生图"):
            from ui.text_to_img import TextToImg
            TextToImg(URL=URL, INPUT_DIR=INPUT_DIR, OUTPUT_DIR=OUTPUT_DIR).ui()

        with gr.Tab("视频转绘制"):
            pass


    return index


if __name__ == "__main__":
    index = index_box()
    index.queue()
    index.launch()
